package com.yonyou.cyxdms.basedata.service.entity.color;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 车辆颜色
 * </p>
 *
 * @author guorp
 * @since 2018-12-14
 */
@TableName("tm_color")
public class ColorPO extends DMSBasePO<ColorPO> {

    private static final long serialVersionUID = 1L;

    /**
     * 颜色ID
     */
    @TableId(value = "COLOR_ID", type = IdType.AUTO)
    private Integer colorId;

    /**
     * APP_ID
     */
    @TableField("APP_ID")
    private String appId;

    /**
     * 公司代码
     */
    @TableField("COMPANY_CODE")
    private String companyCode;

    /**
     * 所有者代码
     */
    @TableField("OWNER_CODE")
    private String ownerCode;

    /**
     * 所有者的父组织代码（用于二网使用）
     */
    @TableField("OWNER_PAR_CODE")
    private String ownerParCode;


    /**
     * 颜色类型(内饰色，外饰色)
     */
    @TableField("COLOR_TYPE")
    private Integer colorType;

    /**
     * 颜色代码
     */
    @TableField("COLOR_CODE")
    private String colorCode;


    /**
     * 颜色名称
     */
    @TableField("COLOR_NAME")
    private String colorName;

    /**
     * 数据来源
     */
    @TableField("DATA_SOURCES")
    private Integer dataSources;

    /**
     * 是否有效
     */
    @TableField("IS_VALID")
    private Integer isValid;

    /**
     * 数据来源
     */
    @TableField("SOURCE_ID")
    private String sourceId;

    /**
     * 数据来源时间
     */
    @TableField("SOURCE_CHANGED_AT")
    private LocalDateTime sourceChangedAt;

    @TableField("CREATED_BY")
    private String createdBy;

    @TableField("CREATED_AT")
    private LocalDateTime createdAt;


    @TableField("IS_ISSUE")
    private Integer isIssue;

    @TableField("SEND_DATE")
    private LocalDateTime sendDate;

    @TableField("DEALER_PRICE")
    private BigDecimal dealerPrice;

    @TableField("OEM_PRICE")
    private BigDecimal oemPrice;

    public static long getSerialVersionUid() {
        return serialVersionUID;
    }

    public Integer getIsIssue() {
        return isIssue;
    }

    public void setIsIssue(Integer isIssue) {
        this.isIssue = isIssue;
    }

    public LocalDateTime getSendDate() {
        return sendDate;
    }

    public void setSendDate(LocalDateTime sendDate) {
        this.sendDate = sendDate;
    }

    public String getSendBy() {
        return sendBy;
    }

    public void setSendBy(String sendBy) {
        this.sendBy = sendBy;
    }

    @TableField("SEND_BY")
    private String sendBy;

    public Integer getColorId() {
        return colorId;
    }

    public void setColorId(Integer colorId) {
        this.colorId = colorId;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    public String getOwnerParCode() {
        return ownerParCode;
    }

    public void setOwnerParCode(String ownerParCode) {
        this.ownerParCode = ownerParCode;
    }

    public Integer getColorType() {
        return colorType;
    }

    public void setColorType(Integer colorType) {
        this.colorType = colorType;
    }

    public String getColorCode() {
        return colorCode;
    }

    public void setColorCode(String colorCode) {
        this.colorCode = colorCode;
    }

    public String getColorName() {
        return colorName;
    }

    public void setColorName(String colorName) {
        this.colorName = colorName;
    }

    public Integer getDataSources() {
        return dataSources;
    }

    public void setDataSources(Integer dataSources) {
        this.dataSources = dataSources;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public String getSourceId() {
        return sourceId;
    }

    public void setSourceId(String sourceId) {
        this.sourceId = sourceId;
    }

    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }

    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }

    @Override
    public String getCreatedBy() {
        return createdBy;
    }

    @Override
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Override
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    @Override
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public BigDecimal getDealerPrice() {
        return dealerPrice;
    }

    public void setDealerPrice(BigDecimal dealerPrice) {
        this.dealerPrice = dealerPrice;
    }

    public BigDecimal getOemPrice() {
        return oemPrice;
    }

    public void setOemPrice(BigDecimal oemPrice) {
        this.oemPrice = oemPrice;
    }

    @Override
    public String toString() {
        return "ColorPO{" +
                "colorId=" + colorId +
                ", appId='" + appId + '\'' +
                ", companyCode='" + companyCode + '\'' +
                ", ownerCode='" + ownerCode + '\'' +
                ", ownerParCode='" + ownerParCode + '\'' +
                ", colorType=" + colorType +
                ", colorCode='" + colorCode + '\'' +
                ", colorName='" + colorName + '\'' +
                ", dataSources=" + dataSources +
                ", isValid=" + isValid +
                ", sourceId='" + sourceId + '\'' +
                ", sourceChangedAt=" + sourceChangedAt +
                ", createdBy='" + createdBy + '\'' +
                ", createdAt=" + createdAt +
                ", isIssue=" + isIssue +
                ", sendDate=" + sendDate +
                ", sendBy='" + sendBy + '\'' +
                '}';
    }

    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author guorp
     * @since 2018/7/22 0022
     */
    protected <T extends DMSBaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "colorId");
    }


}
